home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / misc / st4amiga.lha / ST / ST.s < prev   
Text File  |  1995-08-23  |  2KB  |  132 lines

  1. ; © Stefan Haubenthal 1992-95
  2. *    opt    o+
  3. *    include    prog:asm/include/wb.i
  4. *    incdir    prog:asm/include
  5. *    include    easystart.i
  6.  
  7. version=    "2.10"
  8. allocabs=    -$0cc
  9. freemem=    -$0d2
  10. oldopenlibrary=    -$198
  11. closelibrary=    -$19e
  12. open=        -$01e
  13. read=        -$02a
  14. datestamp=    -$0c0
  15. copymemquick=    -$276
  16. mode_oldfile=    1005
  17.  
  18. io=        $18000;  32K
  19. emu=        $20000
  20. temp=        $23100;  24 bytes
  21. buffer=        $24000
  22. scr=        $30000
  23. scrsize=    $8000; ± 32K
  24. dsk=        $38004
  25. dsksize=    $4000;   16K
  26. rom=        $40000
  27. romsize=    $40000; 256K/192K
  28. oldrom=        $fc0000
  29.  
  30.     move.l    4.w,a6
  31.     move.l    #romsize,d0
  32.     lea    rom,a1
  33.     jsr    allocabs(a6)
  34.     tst.l    d0
  35.     beq    exit
  36.     move.l    #emusize,d0
  37.     lea    emu,a1
  38.     jsr    allocabs(a6)
  39.     tst.l    d0
  40.     beq.s    exit
  41.     lea    dosname(pc),a1
  42.     jsr    oldopenlibrary(a6)
  43.     move.l    d0,a6
  44.     move.l    #romname,d1
  45.     move.l    #mode_oldfile,d2
  46.     jsr    open(a6)
  47.     beq.s    exit2
  48.     move.l    d0,d1
  49.     move.l    #rom,d2
  50.     move.l    #romsize,d3
  51.     jsr    read(a6)
  52.     bsr.s    patch
  53.     bsr.s    time
  54.     move.l    4.w,a6
  55.     lea    start_emu,a0
  56.     lea    emu,a1
  57.     move.l    #emusize,d0
  58.     jsr    copymemquick(a6)
  59.     jmp    emu+4
  60. ; goodbye AmigaDOS!
  61. exit2    move.l    a6,a1
  62.     move.l    4.w,a6
  63.     jsr    closelibrary(a6)
  64.     move.l    #emusize,d0
  65.     lea    emu,a1
  66.     jsr    freemem(a6)
  67. exit    moveq    #20,d0
  68.     rts
  69.  
  70. patch    lea    reloc,a0
  71.     sub.l    a1,a1
  72. next_reloc    moveq    #0,d0
  73.     cmp    #0,(a0)
  74.     add    (a0)+,a1
  75.     bne.s    not_packed
  76.     move.b    (a0)+,d0
  77.     move.b    (a0)+,d1
  78. next_packed    add    d1,a1
  79. not_packed    sub.b    #(oldrom-rom)>>16,(a1,d2.l)
  80.     dbra    d0,next_packed
  81.     cmp.l    #diff,a0
  82.     blo.s    next_reloc
  83. next_diff    move.l    (a0)+,a1
  84.     move    (a0)+,d0
  85.     move.b    d0,(a1,d2.l)
  86.     cmp.l    #end_diff,a0
  87.     blo.s    next_diff
  88.     rts
  89.  
  90. DIGITS    macro
  91.     move.b    d0,d2
  92.     and.b    #$f,d2
  93.     move.b    d2,\1
  94.     lsr.b    #4,d0
  95.     move.b    d0,\2
  96.     endm
  97. time    move.l    #vector,d1
  98.     jsr    datestamp(a6)
  99.     move.l    vector+4,d0
  100.     divu    #60,d0    ; hours
  101.     DIGITS    start_emu+$57,start_emu+$5f
  102.     swap    d0    ; minutes
  103.     DIGITS    start_emu+$47,start_emu+$4f
  104.     move.l    vector+8,d0
  105.     divu    #50,d0    ; seconds
  106.     DIGITS    start_emu+$37,start_emu+$3f
  107.     rts
  108.  
  109.     dc.b    "$VER: ST4Amiga V"
  110.     dc.l    version
  111.     dc.b    0
  112. dosname    dc.b    "dos.library",0
  113. romname    dc.b    "TOS.IMG",0
  114. vector    ds.l    3
  115.  
  116.     data
  117. ; { delta_offset.w
  118. ; | 0.w number-1.b delta_offset.b }
  119. reloc    include    reloc.asm
  120. ; { offset.l data.w }
  121. diff    include    diff.asm
  122. end_diff
  123.  
  124.     code
  125. temp1    EQU    temp
  126. temp2    EQU    temp1+2
  127. temp3    EQU    temp2+2
  128. temp4    EQU    temp3+2
  129. start_emu    include    emu.asm
  130. emusize=    *-emu
  131.     end
  132.